package server;


/**
 * @Author YWB
 * @Date 2021/1/15
 * desc 针对处理HTTP请求方式
 **/
public abstract class HttpServlet implements Servlet {

    public abstract void doGet(Request request,Response response);
    public abstract void doPost(Request request,Response response);

    @Override
    public void service(Request request,Response response) {
        if("GET".equalsIgnoreCase(request.getMethod())){
            doGet(request,response);
        }else{
            doPost(request,response);
        }
    }
}
